package com.secxiot.common.exception;

import com.secxiot.common.constant.ServerStatusEnum;

public class BaseException extends Exception {

    private ServerStatusEnum exEnum;

    private int status;

    private String message;

    public BaseException(ServerStatusEnum exEnum, Throwable cause) {
        super(exEnum.getStatus() + "|" +exEnum.getMessage(), cause);
        this.exEnum = exEnum;
        this.status = exEnum.getStatus();
        this.message = exEnum.getMessage();
    }

    public BaseException( ServerStatusEnum exEnum) {
        super(exEnum.getStatus() + "|" +exEnum.getMessage());
        this.exEnum = exEnum;
        this.status = exEnum.getStatus();
        this.message = exEnum.getMessage();
    }

    public ServerStatusEnum getExEnum() {
        return exEnum;
    }
}
